package com.aaa.service.impl;

import com.aaa.dao.L_PointSetDao;
import com.aaa.service.L_PointSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class L_PointSetServiceImpl implements L_PointSetService {
    @Autowired
    private L_PointSetDao pointSetDao;
    @Override
    public Boolean addSet(Map map) {
        int i=pointSetDao.SetDao(map);
        if (i>0){
            return  true;
        }
        return false;
    }

    @Override
    public List<Map> Score() {
        List<Map> list=new ArrayList<>();
        Map map=new HashMap();
        for (int i = 0; i <pointSetDao.Score().size(); i++) {
            list.add(pointSetDao.Score().get(i));
        }
        return list;
    }

    @Override
    public List<Map> Content() {

        return pointSetDao.Content();
    }

    @Override
    public List<Map> getunit() {
        return pointSetDao.getunit();
    }


    //扣分项查重
    @Override
    public int chachong(Map map) {
        List<Map> list=pointSetDao.chachong(map);
        if (list.size()>0){
            return  1;
        }else {
            return 0;
        }
    }

    @Override
    public int getunitID(Map map) {
        return pointSetDao.getunitID(map);
    }

    @Override
    public void setRegist(Map map) {
        pointSetDao.setRegist(map);
    }

    @Override
    public List<Map> cpscore(Map map) {
        return pointSetDao.cpscore(map);
    }

    @Override
    public void addcpscore(Map map) {
        pointSetDao.addcpscore(map);
    }
}
